import Vue from 'vue'
import App from './App.vue'

// 引入组件    一级路由
import Find from "./views/Find.vue"
import My from "./views/My.vue"
import Part from "./views/Part.vue"
import NotFound from "./views/NotFound.vue"
// 二级路由
import Recommend from "./views/second/Recommend.vue"
import Ranking from "./views/second/Ranking.vue"
import SongList from "./views/second/SongList.vue"
// 三级路由
import Teal from "./views/second/three/Teal.vue"
import Pink from "./views/second/three/Pink.vue"
import Green from "./views/second/three/Green.vue"
Vue.config.productionTip = false

import VueRouter from 'vue-router'

Vue.use(VueRouter)

let routes = [{
    path: "/",
    redirect: "/find"
  },
  {
    name:"find",
    path: "/find",
    component: Find,
    children: [{
        path: "",
        redirect: "recommend"
      },
      {
        path: "recommend",
        component: Recommend,
        children: [{
          // 重定向
          path: "",
          redirect: "teal"
        }, {
          path: "teal",
          component: Teal
        }, {
          path: "pink",
          component: Pink
        }, {
          path: "green",
          component: Green
        }]
      },
      {
        path: "ranking",
        component: Ranking
      },
      {
        path: "songlist",
        component: SongList
      }
    ]
  },
  {
    name: "my",
    path: "/my",
    component: My
  },
  {
    path: "/my/:msg",
    component: My

  },
  {
    name: "part",
    path: "/part",
    component: Part
  },
  {
    path: "*",
    component: NotFound
  }
]

let router = new VueRouter({
  routes,
  mode: "history"
})

new Vue({
  render: h => h(App),
  router
}).$mount('#app')